<?php

        class message extends database_helper
        {

               /**
                *  Return instance of object
                */
               public function getInstance($id = 0)
               {
                   return new message($id, $this->target);
               }




                /**
                 * Create a static page object
                 * $id - id or alias
                 */
                public function message(&$target)
                {
                        database_helper::database_helper($target, 'messages');
                }


                /**
                 *Get WHERE part of SQL query for queries
                 */
                public function parse_filter($filter = array(), &$join = '')
                {
                    // compulsory part of query
                    $where_filter = parent::parse_filter($filter, $join);

/*                    if (isset($filter['parentId'])) {
                        $filter['parentId'] = (int)$filter['parentId'];
                        $where_filter .= " AND {$this->table_alias}.parentId = '{$filter['parentId']}' ";
                    }

                    if (isset($filter['type'])) {
                        $filter['type'] = addslashes($filter['type']);
                        $where_filter .= " AND {$this->table_alias}.type = '{$filter['type']}'";
                    }

                    if (isset($filter['year(date)'])) {
                        $filter['year(date)'] = (int)$filter['year(date)'];
                        $where_filter .= " AND YEAR( {$this->table_alias}.date)  = '{$filter['year(date)']}'";
                    }

                    if (isset($filter['month(date)'])) {
                        $filter['month(date)'] = (int)$filter['month(date)'];
                        $where_filter .= " AND MONTH( {$this->table_alias}.date)  = '{$filter['month(date)']}'";
                    }*/
                    return $where_filter;
                }


        };